﻿using Google.Protobuf.WellKnownTypes;
using Nacos.V2;
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ocelot.Provider.Nacos;

public class NacosConfigListen : IListener
{
    public void ReceiveConfigInfo(string configInfo)
    {
        // 这里会有配置变更的回调，在这里处理配置变更之后的逻辑。
        System.Console.WriteLine("config change " + configInfo);

        //重启ocelot
        Global.WebApplication.UseOcelot().Wait();
    }

}
